from django.shortcuts import render, HttpResponse, reverse
import time


# Create your views here.


def func(request):
    print(reverse('app02:func_view'))
    return HttpResponse('from app02 func')


def index(request):
    user_data = {'username': 'jason', 'password': 123, 'hobby': ['read', 'music', 'run']}
    # return render(request, 'index.html', {'d': user_data})   # 在字典中键值对挨个传
    # return render(request, 'index.html', locals())  # 名称空间中所有的名字
    i = 123
    f = 11.11
    s = 'ckkyydschb6666 kkk kk l ll lll lllii'
    l = [11, 22, 33, 44]
    d = {'username': 'jason', 'password': 123, 'hobby': ['read', 'music', 'run']}
    b = True
    t = (11, 22, 33, 44)
    se = {11, 22, 33, 44, 55, 66}

    def func1():
        print('ckkk11111函数')

    def func2(a, b):
        print('ckkk11111函数')

    class Myclass1(object):
        # pass
        # obj = Myclass1()

        def get_obj(self):
            return '绑定给对象的方法'

        @classmethod
        def get_cls(cls):
            return '绑定给类的方法'

        @staticmethod
        def get_static():
            return '类中定义的普通函数'

    obj = Myclass1()
    import datetime
    ctime = datetime.date.today()

    file_size = 1243333
    html_code = '<h1>呵呵呵</h1>'
    return render(request, 'index.html', locals())


def home2(request):
    return render(request, 'home2.html')


def login(request):
    return render(request, 'login2.html')


def register(request):
    return render(request, 'register2.html')

